Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Django 5.x and Python 3.12 #17

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

sckarlin
Copy link

Hi Lance,

Per our off-line discussion, here's a PR:

  • Add support for Django 5.x and Python 3.12
  • Drop support for unsupported Django and Python
  • Miscellaneous spelling/grammar edits to appease PyChram
  • Move from setup.py to pyproject.toml configuration
  • Adds initial type annotations
  • runtests.py accepts arguments to limit tests that are run
  • marked as version 1.5.0

Regards,

Scott

@lgoodridge
Copy link
Owner

Hi! Thanks for the PR, and acknowledging that I've seen this.

My major concern is that this package is used by several other projects, at least one of which is still on python 2.7 (I know, I know), and it would be nice to keep it supported with the latest versions. Worse case scenario we can drop it, but let me fiddle with it for the next few days and see if I can have my cake and eat it too.

Less seriously, I don't love the .pyi files (mostly because I don't use PyCharm, and could very easily forget to update the other file), though I understand the desire for type hinting. I may .gitignore them for now (depending on the outcome of the above).

@sckarlin
Copy link
Author

sckarlin commented Jun 4, 2024

My thought would be that clients still on old versions of Python might have to restrict their version of this package to something like <1.5.0. The .pyi files are for anything that can use them: mypy or IDEs like VS Code and PyCharm. Other than requiring them to be syntactically valid, Python ignores them. As for making sure that the .py and .pyi files don't diverge, we can add mypy to the CI script. Ordinarily, I'd put the annotations inline with the code for readability; however, annotations weren't introduced until Python 3.5 and some of the features I used didn't appear until Python 3.9 or so. Thanks for considering.

@sckarlin
Copy link
Author

sckarlin commented Jun 4, 2024

Clarification: inline annotations need to be syntactically valid Python (versions 3.5 and above depending on type annotation features). Annotations in .pyi files are only read by and relevant to typing tools like mypy or IDEs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants